package com.locpx.lct;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class LCTFileFilter extends FileFilter {
	public static final String FILE_TYPE_PGN = ".pgn";
	public static final String FILE_TYPE_JPG = ".jpg";
	
	private String fileExtention;
	private String fileDescription;
	
	public LCTFileFilter(String fileExtention, String fileDescription) {
		super();
		this.fileExtention = fileExtention;
		this.fileDescription = fileDescription;
	}

	@Override
	public boolean accept(File f) {
		return f.isDirectory() || f.getName().toLowerCase().endsWith(fileExtention);
	}

	@Override
	public String getDescription() {
		return fileDescription;
	}
}